/*
 * @Author: 137 '1432417996@qq.com'
 * @Date: 2025-04-17 01:48:41
 * @LastEditors: 137 '1432417996@qq.com'
 * @LastEditTime: 2025-05-15 20:50:06
 * @FilePath: \starter-3\api\information.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {request} from '@/api/request'

// 查询资讯作者详情
export function getNewsAuthor(authorId) {
    return request({
        url: `/news/p/author/${authorId}`,
        method: 'get',
    })
}

// 检查是否关注作者
export function checkFollowAuthor(authorId) {
    return request({
        url: `/news/p/author/check-follow/${authorId}`,
        method: 'get',
    })
}

// 查询资讯详情
export function getNewsDetail(newsId) {
    return request({
        url: `/news/p/detail/${newsId}`,
        method: 'get',
    })
}

// 查询头条资讯列表
export function getNewsHeadlines(data) {
    return request({
        url: '/news/p/headlines',
        method: 'get',
        params: data
    })
}

// 查询热门资讯列表
export function getNewsHot() {
    return request({
        url: '/news/p/hot',
        method: 'get',
    })
}

// 查询资讯列表
export function getNewsList(data) {
    return request({
        url: '/news/p/list',
        method: 'post',
        data
    })
}

// 资讯互动操作（点赞/点踩/收藏）
export function getNewsAction(data) {
    return request({
        url: '/news/a/action',
        method: 'post',
        data
    })
}

// 资讯广告点击记录
export function getNewsAdClick(data) {
    return request({
        url: '/news/ad/p/click',
        method: 'post',
        data
    })
}

// 查询有效资讯广告列表
export function getNewsAdList() {
    return request({
        url: '/news/ad/p/list',
        method: 'get',
    })
}

// 查询资讯置顶列表
export function getNewsTop() {
    return request({
        url: '/news/p/top',
        method: 'get',
    })
}

